function debounce(fn, delay) {
    let time = null
    return (...arg) => {
        if (time) clearInterval(time)
        time = setTimeout(() => {
            fn.apply(this, arg)
        }, delay)
    }
}
function throttle(fn, delay) {
    let time = 0
    return (...arg) => {
        const now = Date.now()
        if (now - time > delay) {
            time = now
            fn(...arg)
        }

    }
}



